home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir34
/
dsktest.zip
/
ERRLEV.BAT
< prev
next >
Wrap
DOS Batch File
|
1993-05-25
|
793b
|
22 lines
@echo off
rem Use CALL ERRLEV.BAT (DOS 3.3+) in a batch file to place the errorlevel
rem into the environment as EL=xxx where xxx is an ASCII(!) string
rem representation of the errorlevel. It is also written to the screen.
set EL=
for %%V in (0 1 2) do if errorlevel %%V00 set EL=%%V
if "%EL%"=="2" goto OVER200
for %%V in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %EL%%%V0 set EL=%EL%%%V
goto DIGIT2
:OVER200
for %%V in (0 1 2 3 4 5) do if errorlevel %EL%%%V0 set EL=%EL%%%V
:DIGIT2
if "%EL%"=="25" goto OVER250
goto DIGIT3
:OVER250
for %%V in (0 1 2 3 4 5) do if errorlevel %EL%%%V set EL=%EL%%%V
goto DONE
:DIGIT3
for %%V in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %EL%%%V set EL=%EL%%%V
:DONE
echo The resulting ERRORLEVEL value transferred to the environment is EL=%EL%